//
//  InputTableViewCell.m
//  FindJob
//
//  Created by 233 on 16/3/3.
//  Copyright © 2016年 Lee. All rights reserved.
//

#import "InputTableViewCell.h"


@interface InputTableViewCell()<UITextFieldDelegate>
@property(nonatomic,strong)UIControl *coverView;
@end
@implementation InputTableViewCell

- (void)awakeFromNib {
    self.inputTextField.delegate = self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

}
#pragma mark -- UITextFieldDelegate-
- (void)textFieldDidBeginEditing:(UITextField *)textField{
    [[UIApplication sharedApplication].keyWindow addSubview:self.coverView];
}
#pragma mark -- prviat
- (void)respondsTapCoverView{
    [self.inputTextField resignFirstResponder];
    [self.coverView removeFromSuperview];
}
#pragma mark -- getter
- (UIControl *)coverView{
    if (_coverView == nil) {
        _coverView = [[UIControl alloc] initWithFrame:[UIScreen mainScreen].bounds];
        _coverView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.4 ];
        [_coverView addTarget:self action:@selector(respondsTapCoverView) forControlEvents:UIControlEventTouchDown];
    }
    return _coverView;
}
@end
